package com.wf.classRoomTest.server;

import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.net.InetAddress;
import java.net.Socket;
import java.net.UnknownHostException;

public class TCPClient {
    public static void main(String[] args) {

        try (

                Socket socket = new Socket("localhost", 8090);
                PrintWriter writer = new PrintWriter(socket.getOutputStream());
        ) {
            writer.print("你好，我是客户端！");

        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }

}
